<template>
	<div class="view">
		<!-- <template>
			<Top :title="'查询记录'"></Top>
		</template> -->
		<div class="header">
			<div class="h_exit" @click="toIndex">
				<i class="i-exit i-20 i-mr-10"></i>
				<div class="h_str">返回上一页</div>
			</div>
			<div class="h_con">
				<div class="h_li">保险追踪</div>
			</div>
		</div>

		<div class="main">
			<div class="main_con">
				<div class="m_title">保险追踪</div>
				<!-- <div class="line">
					<div class="search">
						<el-input placeholder="请输入关键词" suffix-icon="el-icon-search" v-model="keywords"
							@change="search" size="medium" style="width: 200px;">
						</el-input>
						<el-select v-model="isTalent" placeholder="请选择类型" style="width: 200px;margin-right: 10px">
							<el-option v-for="item in options" :key="item.title" :label="item.title"
								:value="item.title">
							</el-option>
						</el-select>
						<el-button type="primary" size="medium" @click="search">搜索</el-button>
					</div>
				</div> -->

				<div class="table">
					<el-table style="width: 100%;" :data="dataList" :height="table_height">
						<el-table-column type="selection" min-width="5%" align="center">
						</el-table-column>
						<el-table-column type="index" :index="1" label="行号" min-width="10%" align="center">
						</el-table-column>
                        <el-table-column prop="acName" label="企业名称" min-width="30%" align="center">
							<template  slot-scope="scope">
								{{ scope.row.acName }}({{ scope.row.acTel }})
							</template>
						</el-table-column>
                        <el-table-column prop="asName" label="求职者名称" min-width="30%" align="center">
							<template  slot-scope="scope">
								{{ scope.row.asName }}({{ scope.row.asTel }})
							</template>
						</el-table-column>
                        <el-table-column prop="isTongyi" label="是否同意追踪保险进度" min-width="20%" align="center">
							<template slot-scope="scope">
								{{ scope.row.isTongyi==null?"-":(scope.row.isTongyi==1?"同意":"不同意") }}
							</template>
						</el-table-column>
                        <el-table-column prop="timeModified" label="日期" min-width="20%" align="center">
						</el-table-column>
					</el-table>
				</div>
				<div class="item_bottom">
					<div class="item_num">共{{ total }}条信息</div>
					<div class="item_page">
						<el-pagination background layout="prev, pager, next" :total="total"
							@current-change="handleCurrentChange">
						</el-pagination>
					</div>
				</div>
			</div>
		</div>

	</div>
</template>

<script>
import Top from "../../components/top.vue"
import {mapGetters} from "vuex"
export default {
	components: {
		Top,
	},
	data() {
		return {
			keywords: "",
			table_height: document.documentElement.clientHeight - 360,
			diaHeight: document.documentElement.clientHeight - 142,
			dataList: [],
			total: 10,
			dialogVisible: false,

			form: {
				adminname: "",
				pwd: "",
				pwd2: "",
				id: "",
			},

			li_num: 1,
			left: 0,
			current: 1,
			limit: 10,
			isEdit:false,
			isTalent:null,
		}

	},
	computed:{
		...mapGetters(['isRole'])
	},
	methods: {
		// 搜索
		search() {
			this.current = 1
			this.dataInit()
		},
		toIndex() {
			this.$router.push('/')
		},
		enter(num) {
			if (num == 1) {
				this.left = 0
			} else {
				this.left = 110
			}
		},

		leave() {
			if (this.li_num == 1) {
				this.left = 0
			} else {
				this.left = 110
			}
		},

		li_click(num) {
			this.li_num = num
			if (num == 2) {
				this.$router.push('/role')
			}
		},

		// 打开上传图片弹窗
		imgUpload() {
			this.cropperModel = true
		},

		comment1() {
			this.$refs['form1'].validate((valid) => {
				if (valid) {

				} else {
					console.log('error submit!!');
					return false;
				}
			});
		},

		dataInit() {
			this.$http({
				'method': 'post',
				'url': this.$api.insurance,
				data: {
					current: this.current,
					limit: this.limit
				}
			}).then(res => {
				if (res.data.code == 20000) {
					this.dataList = res.data.data.list
					this.total = res.data.data.total
					console.log(this.dataList)
				}
			})
		},


		// 分页
		handleCurrentChange(num) {
			this.current = num;
			this.dataInit();
		},

		//图片上传成功后
		handleUploadSuccess(data) {
			this.cropperModel = false;
			this.cropperName = '';
			this.form1.picdir = data.url
		},
	},
	created() {
		this.dataInit()
	}

}
</script>

<style scoped>
@import url(../../assets/css/class.css);
</style>
